package com.gaia.member.gaiatt.login;


import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;

import com.gaia.member.gaiatt.R;
import com.gaia.member.gaiatt.message.MessageHomeActivity;
import com.gaia.member.gaiatt.mygaia.MyGaiaHomeActivity;
import com.gaia.member.gaiatt.utils.ZhtUtils;

import butterknife.Bind;
import butterknife.ButterKnife;


/**
 * A login screen that offers login via username/password.
 * created by zhangHaiTao at 2016/4/25
 */
public class StartActivity extends Activity {
    @Bind(R.id.btn_test)
    Button btnTest;
    @Bind(R.id.btn_message)
    Button btnMessage;
    @Bind(R.id.btn_mygaia)
    Button btnMygaia;
    private Button btn_regist, btn_login;
    private Activity mContext;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        mContext = this;
        setContentView(R.layout.activity_start);
        ButterKnife.bind(this);
        initView();

    }

    /**
     * 初始化控件，设置监听事件
     */
    private void initView() {
        btn_login = (Button) findViewById(R.id.btn_login);
        btn_regist = (Button) findViewById(R.id.btn_regist);

        //登录
        btn_login.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                Intent intent = new Intent(mContext, LoginActivity.class);
                startActivity(intent);
            }
        });

        //注册
        btn_regist.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                Intent intent = new Intent(mContext, RegistWelcomeActivity.class);
                startActivity(intent);
//                finish();
            }
        });


        btnTest.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                ZhtUtils.gotoIntent(mContext, testActivity.class);
            }
        });

        btnMessage.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                ZhtUtils.gotoIntent(mContext, MessageHomeActivity.class);
            }
        });


        btnMygaia.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                ZhtUtils.gotoIntent(mContext, MyGaiaHomeActivity.class);
            }
        });
    }


}